package com.mt.api.modules.manager.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mt.api.modules.domain.Menu;
import com.mt.api.modules.manager.IMenuManager;
import com.mt.api.modules.mapper.MenuMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Author: plover
 * @Date: 2022-04-30
 * @Description:
 */
@Component
public class MenuManagerImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuManager {


    @Override
    public List<Menu> getList() {
        LambdaQueryWrapper<Menu> wrapper = Wrappers.lambdaQuery();
        return baseMapper.selectList(wrapper);
    }

    @Override
    public List<Menu> getListByMenuIds(List<Integer> menuIds) {
        LambdaQueryWrapper<Menu> wrapper = Wrappers.lambdaQuery();
        wrapper.in(Menu::getId, menuIds);
        return baseMapper.selectList(wrapper);
    }
}
